@page "{id:min(1)}"
@model StudentManagement.RazorPage.Pages.Students.EditModel
@{
    ViewData["Title"] = "编辑";

}

<h1>编辑学生</h1>

<form method="post" class="mt-3">
    @*使用隐藏的input标签来存储提交表单时需要的学生id*@
    <input hidden asp-for="Student.Id" />

    @*asp-for TagHelper 负责在处理在不同的标签中显示现有的数据*@
    <div class="form-group row">
        <label asp-for="Student.Name" class="col-sm-2 col-form-label">
        </label>
        <div class="col-sm-10">
            <input asp-for="Student.Name" class="form-control" placeholder="Name">
        </div>
    </div>
    <div class="form-group row">
        <label asp-for="Student.Email" class="col-sm-2 col-form-label"></label>
        <div class="col-sm-10">
            <input asp-for="Student.Email" class="form-control" placeholder="Email">
        </div>
    </div>

    <div class="form-group row">
        <label asp-for="Student.ClassName" class="col-sm-2 col-form-label"></label>
        <div class="col-sm-10">
            <select asp-for="Student.ClassName" class="custom-select mr-sm-2"
                    asp-items="Html.GetEnumSelectList<ClassNameEnum>()">
                <option value="">请选择</option>
            </select>
        </div>
    </div>

    <div class="form-group row">
        <div class="col-sm-10">
            <button type="submit" class="btn btn-primary">更新</button>
            <a asp-page="/Student/Index" class="btn btn-primary">取消</a>
        </div>
    </div>
</form>